import Vue from 'vue'
import Vuex from 'vuex'
import logger from 'vuex/dist/logger'
import * as getters from './getters'
import * as actions from './actions'
import modules from './modules/modules'
import token from './modules/token'
import layout from './modules/layout'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 测试环境
    imgUrl: 'http://ecshoptest.ebj.ebjcloud.com/ecshop/img/',
    exportUrl:'http://ecshoptest.ebj.ebjcloud.com/',
    // 生产环境
    // imgUrl: 'http://oneshop.1bpcafe.cn/ecshop/img/',
    // exportUrl:'http://oneshop.1bpcafe.cn/',
    onlyLook: false,
    bottonShow: true
  },
  mutations: {
    setOnlyLook (state, data) {
      state.onlyLook = data
    }
  },
  getters,
  actions,
  modules: {token, layout, modules},
  plugins: process.env.NODE_ENV === 'production' ? [] : [logger()],
  strict: process.env.NODE_ENV !== 'production'
})
